_markers=[];

while { true } do
{
	_agentGroup=AgentGroup;
    
	{ // foreach agent
        
		// we show the agent on the map
		_agentMarker=createMarkerLocal [ (format["%1",_x]) , [(getPos _x) select 0,(getPos _x) select 1] ];
		_agentMarker setMarkerShapeLocal "ICON";
		_agentMarker setMarkerTypeLocal "DOT";
		//player globalChat format["%1",(getPos _x)];
		if (alive _x) then {
			_agentMarker setMarkerColorLocal "ColorGreen";
		}else{
			_agentMarker setMarkerColorLocal "ColorRed";
		};
		
		_agentMarker setMarkerPosLocal (getPos _x);
		_agentMarker setMarkerTextLocal (name _x);

		_markers=_markers+[_agentMarker];
			
		
    }forEach _agentGroup;

    sleep 1;
    
	{
		deleteMarkerLocal _x;
	}forEach _markers;

    _markers=[];

};

	
	

